<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"></script>
</head>

<body>
    <div class="box"></div>
    <button id="">按钮</button>
</body>
<script>
    $(function () {
        $('button').click(function () {
            // $.get(
            //     'http://liu.zzgoodqc.cn/hello',
            //     function (res) {
            //         console.log(res);
            //     },
            //     'json'
            // )

            let data = {
                title: '假数据',
                name: '张三',
                content: '什么啊',
            }
            // $.post(
            //     'http://liu.zzgoodqc.cn/lyb/add',
            //     data,
            //     function (res) {
            //         console.log(res);
            //     },
            //     'json'
            // )

            $.ajax({
                type: 'POST',
                url:'http://liu.zzgoodqc.cn/lyb/add',
                data:data,
                dataType: 'json',
                success: function (res){
                    console.log(res);
                }
            })
        })
    })

</script>

</html>